from src.application.category.dto import CategoryDTO
from src.domain.server.entities.category import CategoryEntity


def convert_category_dto_to_entity(category: CategoryDTO) -> CategoryEntity:
    return CategoryEntity(
        id=category.id,
        name=category.name,
        name_eng=category.name_eng,
        price_4h=category.price_4h,
        price_1d=category.price_1d,
        price_1w=category.price_1w,
        price_2w=category.price_2w,
        price_1m=category.price_1m,
    )


def convert_category_entity_to_dto(category: CategoryEntity) -> CategoryDTO:
    return CategoryDTO(
        id=category.id,
        name=category.name,
        name_eng=category.name_eng,
        price_4h=category.price_4h,
        price_1d=category.price_1d,
        price_1w=category.price_1w,
        price_2w=category.price_2w,
        price_1m=category.price_1m,
    )
